﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

public partial class ConsultaEstados_FrEstadosSistema : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        //-------------------------Lineas Agregadas para la seguridad----------------------------------------------------
        if (Session["nomUsr"] != null)
        {
            List<String> Permisos = (List<String>)Session["Permisos"];

            if (!Permisos.Contains(System.IO.Path.GetFileName(HttpContext.Current.Request.FilePath)))
                Response.Redirect("/SUEWebSite/Error.aspx");
        }
        else
            Response.Redirect("/SUEWebSite/Error.aspx");
        //-------------------------Lineas Agregadas para la seguridad----------------------------------------------------
    }

    private void abreVentana(string ventana)
    {
        string Clientscript = "<script>var ventana_secundaria=window.open('" +
                              ventana +
                              "','miventana','width=250,height=768,menubar=no,scrollbars=yes');if(ventana_secundaria!=null)ventana_secundaria.focus()</script>";

        if (!ClientScript.IsStartupScriptRegistered("WOpen"))
        {
            ClientScript.RegisterStartupScript(this.GetType(), "WOpen", Clientscript);
        }
    }

    protected void Button_Command(object sender, CommandEventArgs e)
    {
        abreVentana("FrResultadoEstado.aspx?cons=" + e.CommandArgument);
    }
}
